
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>数值 · JavaScript学习</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Veng">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="字符串.html" />
    
    
    <link rel="prev" href="let和const命令.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="基础.html">
            
                <a href="基础.html">
            
                    
                    基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="变量.html">
            
                <a href="变量.html">
            
                    
                    数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="let和const命令.html">
            
                <a href="let和const命令.html">
            
                    
                    let和const命令
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.3" data-path="数值.html">
            
                <a href="数值.html">
            
                    
                    数值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="字符串.html">
            
                <a href="字符串.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="对象.html">
            
                <a href="对象.html">
            
                    
                    对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="数组.html">
            
                <a href="数组.html">
            
                    
                    数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="Symbol.html">
            
                <a href="Symbol.html">
            
                    
                    Symbol
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="函数.html">
            
                <a href="函数.html">
            
                    
                    函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.1" data-path="函数的扩展.html">
            
                <a href="函数的扩展.html">
            
                    
                    函数的扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.2" data-path="变量的解构赋值.html">
            
                <a href="变量的解构赋值.html">
            
                    
                    变量作用域与解构赋值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.3" data-path="函数3.html">
            
                <a href="函数3.html">
            
                    
                    方法函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4" data-path="高阶函数.html">
            
                <a href="高阶函数.html">
            
                    
                    高阶函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.4.1" data-path="map-reduce.html">
            
                <a href="map-reduce.html">
            
                    
                    map/reduce
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.2" data-path="filter.html">
            
                <a href="filter.html">
            
                    
                    filter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.3" data-path="sort.html">
            
                <a href="sort.html">
            
                    
                    sort
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4.4" data-path="array其他方法.html">
            
                <a href="array其他方法.html">
            
                    
                    array其他方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.8.5" data-path="闭包.html">
            
                <a href="闭包.html">
            
                    
                    闭包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.6" data-path="箭头函数.html">
            
                <a href="箭头函数.html">
            
                    
                    箭头函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.7" data-path="../浏览器/Promise.html">
            
                <a href="../浏览器/Promise.html">
            
                    
                    Promise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.8" data-path="generator.html">
            
                <a href="generator.html">
            
                    
                    generator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.9" data-path="async.html">
            
                <a href="async.html">
            
                    
                    async
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="标准对象.html">
            
                <a href="标准对象.html">
            
                    
                    标准对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.9.1" data-path="SetMap.html">
            
                <a href="SetMap.html">
            
                    
                    Set,Map
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.2" data-path="Date.html">
            
                <a href="Date.html">
            
                    
                    Date
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.3" data-path="Math.html">
            
                <a href="Math.html">
            
                    
                    Math
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.4" data-path="Proxy.html">
            
                <a href="Proxy.html">
            
                    
                    Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.5" data-path="RepExp.html">
            
                <a href="RepExp.html">
            
                    
                    正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.6" data-path="正则表达式.html">
            
                <a href="正则表达式.html">
            
                    
                    正则表达式别篇
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.7" data-path="json.html">
            
                <a href="json.html">
            
                    
                    JSON
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="面向对象编程.html">
            
                <a href="面向对象编程.html">
            
                    
                    面向对象编程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.10.1" data-path="对象的扩展.html">
            
                <a href="对象的扩展.html">
            
                    
                    对象的扩展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.2" data-path="创建对象.html">
            
                <a href="创建对象.html">
            
                    
                    创建对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.3" data-path="原型继承.html">
            
                <a href="原型继承.html">
            
                    
                    原型继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.4" data-path="class继承.html">
            
                <a href="class继承.html">
            
                    
                    class继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.5" data-path="模块化Module.html">
            
                <a href="模块化Module.html">
            
                    
                    模块化Module
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="异常处理.html">
            
                <a href="异常处理.html">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="编程风格.html">
            
                <a href="编程风格.html">
            
                    
                    编程风格
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../js扩展/js扩展.html">
            
                <a href="../js扩展/js扩展.html">
            
                    
                    js 扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../js扩展/字符串.html">
            
                <a href="../js扩展/字符串.html">
            
                    
                    字符串
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../浏览器/浏览器.html">
            
                <a href="../浏览器/浏览器.html">
            
                    
                    浏览器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../浏览器/浏览器对象.html">
            
                <a href="../浏览器/浏览器对象.html">
            
                    
                    浏览器对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../浏览器/操作DOM.html">
            
                <a href="../浏览器/操作DOM.html">
            
                    
                    操作DOM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../浏览器/更新DOM.html">
            
                <a href="../浏览器/更新DOM.html">
            
                    
                    更新DOM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../浏览器/插入DOM.html">
            
                <a href="../浏览器/插入DOM.html">
            
                    
                    插入DOM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.3" data-path="../浏览器/删除DOM.html">
            
                <a href="../浏览器/删除DOM.html">
            
                    
                    删除DOM
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../浏览器/DOM事件.html">
            
                <a href="../浏览器/DOM事件.html">
            
                    
                    DOM事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../浏览器/操作表单.html">
            
                <a href="../浏览器/操作表单.html">
            
                    
                    操作表单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../浏览器/操作文件.html">
            
                <a href="../浏览器/操作文件.html">
            
                    
                    操作文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../浏览器/AJAX.html">
            
                <a href="../浏览器/AJAX.html">
            
                    
                    AJAX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../浏览器/Canvas.html">
            
                <a href="../浏览器/Canvas.html">
            
                    
                    Canvas
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Jquery/jquery.html">
            
                <a href="../Jquery/jquery.html">
            
                    
                    Jquery
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Jquery/选择器.html">
            
                <a href="../Jquery/选择器.html">
            
                    
                    选择器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../Jquery/层级选择器.html">
            
                <a href="../Jquery/层级选择器.html">
            
                    
                    层级选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../Jquery/查找和过滤.html">
            
                <a href="../Jquery/查找和过滤.html">
            
                    
                    查找和过滤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../Jquery/操作DOM.html">
            
                <a href="../Jquery/操作DOM.html">
            
                    
                    操作DOM
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="../Jquery/修改DOM结构.html">
            
                <a href="../Jquery/修改DOM结构.html">
            
                    
                    修改DOM结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../Jquery/事件.html">
            
                <a href="../Jquery/事件.html">
            
                    
                    事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../Jquery/动画.html">
            
                <a href="../Jquery/动画.html">
            
                    
                    动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../Jquery/AJAX.html">
            
                <a href="../Jquery/AJAX.html">
            
                    
                    AJAX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../Jquery/扩展.html">
            
                <a href="../Jquery/扩展.html">
            
                    
                    扩展
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../nodejs/nodejs.html">
            
                <a href="../nodejs/nodejs.html">
            
                    
                    Nodejs
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../nodejs/模块.html">
            
                <a href="../nodejs/模块.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../nodejs/path.html">
            
                <a href="../nodejs/path.html">
            
                    
                    path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../nodejs/文件操作.html">
            
                <a href="../nodejs/文件操作.html">
            
                    
                    文件操作 fs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../nodejs/流Stream.html">
            
                <a href="../nodejs/流Stream.html">
            
                    
                    流Stream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../nodejs/zlib压缩解压缩.html">
            
                <a href="../nodejs/zlib压缩解压缩.html">
            
                    
                    zlib压缩解压缩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../nodejs/net网络.html">
            
                <a href="../nodejs/net网络.html">
            
                    
                    net网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../nodejs/http.html">
            
                <a href="../nodejs/http.html">
            
                    
                    http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../nodejs/express框架.html">
            
                <a href="../nodejs/express框架.html">
            
                    
                    express框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../nodejs/process进程.html">
            
                <a href="../nodejs/process进程.html">
            
                    
                    process 进程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../nodejs/child_process.html">
            
                <a href="../nodejs/child_process.html">
            
                    
                    child_process
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../nodejs/os.html">
            
                <a href="../nodejs/os.html">
            
                    
                    os-操作系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../react/react.html">
            
                <a href="../react/react.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >数值</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6570;&#x503C;">&#x6570;&#x503C;</h1>
<h3 id="&#x6574;&#x6570;&#x4E0E;&#x6D6E;&#x70B9;&#x6570;">&#x6574;&#x6570;&#x4E0E;&#x6D6E;&#x70B9;&#x6570;</h3>
<p>JavaScript &#x5185;&#x90E8;&#xFF0C;&#x6240;&#x6709;&#x6570;&#x5B57;&#x90FD;&#x662F;&#x4EE5;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x5F62;&#x5F0F;&#x50A8;&#x5B58;&#xFF0C;&#x5373;&#x4F7F;&#x6574;&#x6570;&#x4E5F;&#x662F;&#x5982;&#x6B64;&#x3002;&#x6240;&#x4EE5;&#xFF0C;<code>1</code>&#x4E0E;<code>1.0</code>&#x662F;&#x76F8;&#x540C;&#x7684;&#xFF0C;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x6570;&#x3002;</p>
<pre><code class="lang-jss">1 === 1.0 // true
</code></pre>
<p>&#x7531;&#x4E8E;&#x6D6E;&#x70B9;&#x6570;&#x4E0D;&#x662F;&#x7CBE;&#x786E;&#x7684;&#x503C;&#xFF0C;&#x6240;&#x4EE5;&#x6D89;&#x53CA;&#x5C0F;&#x6570;&#x7684;&#x6BD4;&#x8F83;&#x548C;&#x8FD0;&#x7B97;&#x8981;&#x7279;&#x522B;&#x5C0F;&#x5FC3;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-number">0.1</span> + <span class="hljs-number">0.2</span> === <span class="hljs-number">0.3</span>
<span class="hljs-comment">// false</span>

<span class="hljs-number">0.3</span> / <span class="hljs-number">0.1</span>
<span class="hljs-comment">// 2.9999999999999996</span>

(<span class="hljs-number">0.3</span> - <span class="hljs-number">0.2</span>) === (<span class="hljs-number">0.2</span> - <span class="hljs-number">0.1</span>)
<span class="hljs-comment">// false</span>
</code></pre>
<h3 id="&#x6570;&#x503C;&#x7684;&#x7CBE;&#x5EA6;">&#x6570;&#x503C;&#x7684;&#x7CBE;&#x5EA6;</h3>
<p>&#x6839;&#x636E;&#x56FD;&#x9645;&#x6807;&#x51C6; IEEE 754&#xFF0C;JavaScript &#x6D6E;&#x70B9;&#x6570;&#x7684;64&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x4ECE;&#x6700;&#x5DE6;&#x8FB9;&#x5F00;&#x59CB;&#xFF0C;&#x662F;&#x8FD9;&#x6837;&#x7EC4;&#x6210;&#x7684;&#x3002;</p>
<ul>
<li>&#x7B2C;1&#x4F4D;&#xFF1A;&#x7B26;&#x53F7;&#x4F4D;&#xFF0C;<code>0</code>&#x8868;&#x793A;&#x6B63;&#x6570;&#xFF0C;<code>1</code>&#x8868;&#x793A;&#x8D1F;&#x6570;</li>
<li>&#x7B2C;2&#x4F4D;&#x5230;&#x7B2C;12&#x4F4D;&#xFF08;&#x5171;11&#x4F4D;&#xFF09;&#xFF1A;&#x6307;&#x6570;&#x90E8;&#x5206;</li>
<li>&#x7B2C;13&#x4F4D;&#x5230;&#x7B2C;64&#x4F4D;&#xFF08;&#x5171;52&#x4F4D;&#xFF09;&#xFF1A;&#x5C0F;&#x6570;&#x90E8;&#x5206;&#xFF08;&#x5373;&#x6709;&#x6548;&#x6570;&#x5B57;&#xFF09;</li>
</ul>
<p>&#x7B26;&#x53F7;&#x4F4D;&#x51B3;&#x5B9A;&#x4E86;&#x4E00;&#x4E2A;&#x6570;&#x7684;&#x6B63;&#x8D1F;&#xFF0C;&#x6307;&#x6570;&#x90E8;&#x5206;&#x51B3;&#x5B9A;&#x4E86;&#x6570;&#x503C;&#x7684;&#x5927;&#x5C0F;&#xFF0C;&#x5C0F;&#x6570;&#x90E8;&#x5206;&#x51B3;&#x5B9A;&#x4E86;&#x6570;&#x503C;&#x7684;&#x7CBE;&#x5EA6;&#x3002;</p>
<p>&#x6307;&#x6570;&#x90E8;&#x5206;&#x4E00;&#x5171;&#x6709;11&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x56E0;&#x6B64;&#x5927;&#x5C0F;&#x8303;&#x56F4;&#x5C31;&#x662F;0&#x5230;2047&#x3002;IEEE 754 &#x89C4;&#x5B9A;&#xFF0C;&#x5982;&#x679C;&#x6307;&#x6570;&#x90E8;&#x5206;&#x7684;&#x503C;&#x5728;0&#x5230;2047&#x4E4B;&#x95F4;&#xFF08;&#x4E0D;&#x542B;&#x4E24;&#x4E2A;&#x7AEF;&#x70B9;&#xFF09;&#xFF0C;&#x90A3;&#x4E48;&#x6709;&#x6548;&#x6570;&#x5B57;&#x7684;&#x7B2C;&#x4E00;&#x4F4D;&#x9ED8;&#x8BA4;&#x603B;&#x662F;1&#xFF0C;&#x4E0D;&#x4FDD;&#x5B58;&#x5728;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x4E4B;&#x4E2D;&#x3002;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;&#x6709;&#x6548;&#x6570;&#x5B57;&#x8FD9;&#x65F6;&#x603B;&#x662F;<code>1.xx...xx</code>&#x7684;&#x5F62;&#x5F0F;&#xFF0C;&#x5176;&#x4E2D;<code>xx..xx</code>&#x7684;&#x90E8;&#x5206;&#x4FDD;&#x5B58;&#x5728;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x4E4B;&#x4E2D;&#xFF0C;&#x6700;&#x957F;&#x53EF;&#x80FD;&#x4E3A;52&#x4F4D;&#x3002;&#x56E0;&#x6B64;&#xFF0C;JavaScript &#x63D0;&#x4F9B;&#x7684;&#x6709;&#x6548;&#x6570;&#x5B57;&#x6700;&#x957F;&#x4E3A;53&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#x3002;</p>
<pre><code class="lang-shell">(-1)^&#x7B26;&#x53F7;&#x4F4D; * 1.xx...xx * 2^&#x6307;&#x6570;&#x90E8;&#x5206;
</code></pre>
<p>&#x4E0A;&#x9762;&#x516C;&#x5F0F;&#x662F;&#x6B63;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;&#xFF08;&#x6307;&#x6570;&#x90E8;&#x5206;&#x5728;0&#x5230;2047&#x4E4B;&#x95F4;&#xFF09;&#xFF0C;&#x4E00;&#x4E2A;&#x6570;&#x5728; JavaScript &#x5185;&#x90E8;&#x5B9E;&#x9645;&#x7684;&#x8868;&#x793A;&#x5F62;&#x5F0F;&#x3002;</p>
<p>&#x7CBE;&#x5EA6;&#x6700;&#x591A;&#x53EA;&#x80FD;&#x5230;53&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x7EDD;&#x5BF9;&#x503C;&#x5C0F;&#x4E8E;2&#x7684;53&#x6B21;&#x65B9;&#x7684;&#x6574;&#x6570;&#xFF0C;&#x5373;-253&#x5230;253&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x7CBE;&#x786E;&#x8868;&#x793A;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>)
<span class="hljs-comment">// 9007199254740992</span>

<span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>) + <span class="hljs-number">1</span>
<span class="hljs-comment">// 9007199254740992</span>

<span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>) + <span class="hljs-number">2</span>
<span class="hljs-comment">// 9007199254740994</span>

<span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>) + <span class="hljs-number">3</span>
<span class="hljs-comment">// 9007199254740996</span>

<span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>) + <span class="hljs-number">4</span>
<span class="hljs-comment">// 9007199254740996</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x5927;&#x4E8E;2&#x7684;53&#x6B21;&#x65B9;&#x4EE5;&#x540E;&#xFF0C;&#x6574;&#x6570;&#x8FD0;&#x7B97;&#x7684;&#x7ED3;&#x679C;&#x5F00;&#x59CB;&#x51FA;&#x73B0;&#x9519;&#x8BEF;&#x3002;&#x6240;&#x4EE5;&#xFF0C;&#x5927;&#x4E8E;2&#x7684;53&#x6B21;&#x65B9;&#x7684;&#x6570;&#x503C;&#xFF0C;&#x90FD;&#x65E0;&#x6CD5;&#x4FDD;&#x6301;&#x7CBE;&#x5EA6;&#x3002;&#x7531;&#x4E8E;2&#x7684;53&#x6B21;&#x65B9;&#x662F;&#x4E00;&#x4E2A;16&#x4F4D;&#x7684;&#x5341;&#x8FDB;&#x5236;&#x6570;&#x503C;&#xFF0C;&#x6240;&#x4EE5;&#x7B80;&#x5355;&#x7684;&#x6CD5;&#x5219;&#x5C31;&#x662F;&#xFF0C;JavaScript &#x5BF9;15&#x4F4D;&#x7684;&#x5341;&#x8FDB;&#x5236;&#x6570;&#x90FD;&#x53EF;&#x4EE5;&#x7CBE;&#x786E;&#x5904;&#x7406;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">53</span>)
<span class="hljs-comment">// 9007199254740992</span>

<span class="hljs-comment">// &#x591A;&#x51FA;&#x7684;&#x4E09;&#x4E2A;&#x6709;&#x6548;&#x6570;&#x5B57;&#xFF0C;&#x5C06;&#x65E0;&#x6CD5;&#x4FDD;&#x5B58;</span>
<span class="hljs-number">9007199254740992111</span>
<span class="hljs-comment">// 9007199254740992000</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x793A;&#x4F8B;&#x8868;&#x660E;&#xFF0C;&#x5927;&#x4E8E;2&#x7684;53&#x6B21;&#x65B9;&#x4EE5;&#x540E;&#xFF0C;&#x591A;&#x51FA;&#x6765;&#x7684;&#x6709;&#x6548;&#x6570;&#x5B57;&#xFF08;&#x6700;&#x540E;&#x4E09;&#x4F4D;&#x7684;<code>111</code>&#xFF09;&#x90FD;&#x4F1A;&#x65E0;&#x6CD5;&#x4FDD;&#x5B58;&#xFF0C;&#x53D8;&#x6210;0&#x3002;</p>
<h3 id="&#x6570;&#x503C;&#x7684;&#x8303;&#x56F4;">&#x6570;&#x503C;&#x7684;&#x8303;&#x56F4;</h3>
<p>&#x6839;&#x636E;&#x6807;&#x51C6;&#xFF0C;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x7684;&#x6307;&#x6570;&#x90E8;&#x5206;&#x7684;&#x957F;&#x5EA6;&#x662F;11&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x610F;&#x5473;&#x7740;&#x6307;&#x6570;&#x90E8;&#x5206;&#x7684;&#x6700;&#x5927;&#x503C;&#x662F;2047&#xFF08;2&#x7684;11&#x6B21;&#x65B9;&#x51CF;1&#xFF09;&#x3002;&#x4E5F;&#x5C31;&#x662F;&#x8BF4;&#xFF0C;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x7684;&#x6307;&#x6570;&#x90E8;&#x5206;&#x7684;&#x503C;&#x6700;&#x5927;&#x4E3A;2047&#xFF0C;&#x5206;&#x51FA;&#x4E00;&#x534A;&#x8868;&#x793A;&#x8D1F;&#x6570;&#xFF0C;&#x5219; JavaScript &#x80FD;&#x591F;&#x8868;&#x793A;&#x7684;&#x6570;&#x503C;&#x8303;&#x56F4;&#x4E3A;21024&#x5230;2-1023&#xFF08;&#x5F00;&#x533A;&#x95F4;&#xFF09;&#xFF0C;&#x8D85;&#x51FA;&#x8FD9;&#x4E2A;&#x8303;&#x56F4;&#x7684;&#x6570;&#x65E0;&#x6CD5;&#x8868;&#x793A;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x6570;&#x5927;&#x4E8E;&#x7B49;&#x4E8E;2&#x7684;1024&#x6B21;&#x65B9;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x4F1A;&#x53D1;&#x751F;&#x201C;&#x6B63;&#x5411;&#x6EA2;&#x51FA;&#x201D;&#xFF0C;&#x5373; JavaScript &#x65E0;&#x6CD5;&#x8868;&#x793A;&#x8FD9;&#x4E48;&#x5927;&#x7684;&#x6570;&#xFF0C;&#x8FD9;&#x65F6;&#x5C31;&#x4F1A;&#x8FD4;&#x56DE;<code>Infinity</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">1024</span>) <span class="hljs-comment">// Infinity</span>
</code></pre>
<p>&#x5982;&#x679C;&#x4E00;&#x4E2A;&#x6570;&#x5C0F;&#x4E8E;&#x7B49;&#x4E8E;2&#x7684;-1075&#x6B21;&#x65B9;&#xFF08;&#x6307;&#x6570;&#x90E8;&#x5206;&#x6700;&#x5C0F;&#x503C;-1023&#xFF0C;&#x518D;&#x52A0;&#x4E0A;&#x5C0F;&#x6570;&#x90E8;&#x5206;&#x7684;52&#x4F4D;&#xFF09;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x4F1A;&#x53D1;&#x751F;&#x4E3A;&#x201C;&#x8D1F;&#x5411;&#x6EA2;&#x51FA;&#x201D;&#xFF0C;&#x5373; JavaScript &#x65E0;&#x6CD5;&#x8868;&#x793A;&#x8FD9;&#x4E48;&#x5C0F;&#x7684;&#x6570;&#xFF0C;&#x8FD9;&#x65F6;&#x4F1A;&#x76F4;&#x63A5;&#x8FD4;&#x56DE;0&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">-1075</span>) <span class="hljs-comment">// 0</span>
</code></pre>
<p>JavaScript &#x63D0;&#x4F9B;<code>Number</code>&#x5BF9;&#x8C61;&#x7684;<code>MAX_VALUE</code>&#x548C;<code>MIN_VALUE</code>&#x5C5E;&#x6027;&#xFF0C;&#x8FD4;&#x56DE;&#x53EF;&#x4EE5;&#x8868;&#x793A;&#x7684;&#x5177;&#x4F53;&#x7684;&#x6700;&#x5927;&#x503C;&#x548C;&#x6700;&#x5C0F;&#x503C;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">Number</span>.MAX_VALUE <span class="hljs-comment">// 1.7976931348623157e+308</span>
<span class="hljs-built_in">Number</span>.MIN_VALUE <span class="hljs-comment">// 5e-324</span>
</code></pre>
<h2 id="&#x6570;&#x503C;&#x7684;&#x8868;&#x793A;&#x65B9;&#x6CD5;">&#x6570;&#x503C;&#x7684;&#x8868;&#x793A;&#x65B9;&#x6CD5;</h2>
<p>JavaScript &#x7684;&#x6570;&#x503C;&#x6709;&#x591A;&#x79CD;&#x8868;&#x793A;&#x65B9;&#x6CD5;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x5B57;&#x9762;&#x5F62;&#x5F0F;&#x76F4;&#x63A5;&#x8868;&#x793A;&#xFF0C;&#x6BD4;&#x5982;<code>35</code>&#xFF08;&#x5341;&#x8FDB;&#x5236;&#xFF09;&#x548C;<code>0xFF</code>&#xFF08;&#x5341;&#x516D;&#x8FDB;&#x5236;&#xFF09;&#x3002;</p>
<p>&#x6570;&#x503C;&#x4E5F;&#x53EF;&#x4EE5;&#x91C7;&#x7528;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x8868;&#x793A;&#xFF0C;&#x4E0B;&#x9762;&#x662F;&#x51E0;&#x4E2A;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x7684;&#x4F8B;&#x5B50;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-number">123e3</span> <span class="hljs-comment">// 123000</span>
<span class="hljs-number">123e-3</span> <span class="hljs-comment">// 0.123</span>
<span class="hljs-number">-3.1E+12</span>
<span class="hljs-number">.1e-23</span>
</code></pre>
<p>&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x5141;&#x8BB8;&#x5B57;&#x6BCD;<code>e</code>&#x6216;<code>E</code>&#x7684;&#x540E;&#x9762;&#xFF0C;&#x8DDF;&#x7740;&#x4E00;&#x4E2A;&#x6574;&#x6570;&#xFF0C;&#x8868;&#x793A;&#x8FD9;&#x4E2A;&#x6570;&#x503C;&#x7684;&#x6307;&#x6570;&#x90E8;&#x5206;&#x3002;</p>
<p>&#x4EE5;&#x4E0B;&#x4E24;&#x79CD;&#x60C5;&#x51B5;&#xFF0C;JavaScript &#x4F1A;&#x81EA;&#x52A8;&#x5C06;&#x6570;&#x503C;&#x8F6C;&#x4E3A;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x8868;&#x793A;&#xFF0C;&#x5176;&#x4ED6;&#x60C5;&#x51B5;&#x90FD;&#x91C7;&#x7528;&#x5B57;&#x9762;&#x5F62;&#x5F0F;&#x76F4;&#x63A5;&#x8868;&#x793A;&#x3002;</p>
<p><strong>&#xFF08;1&#xFF09;&#x5C0F;&#x6570;&#x70B9;&#x524D;&#x7684;&#x6570;&#x5B57;&#x591A;&#x4E8E;21&#x4F4D;&#x3002;</strong></p>
<pre><code class="lang-js"><span class="hljs-number">1234567890123456789012</span>
<span class="hljs-comment">// 1.2345678901234568e+21</span>

<span class="hljs-number">123456789012345678901</span>
<span class="hljs-comment">// 123456789012345680000</span>
</code></pre>
<p><strong>&#xFF08;2&#xFF09;&#x5C0F;&#x6570;&#x70B9;&#x540E;&#x7684;&#x96F6;&#x591A;&#x4E8E;5&#x4E2A;&#x3002;</strong></p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x5C0F;&#x6570;&#x70B9;&#x540E;&#x7D27;&#x8DDF;5&#x4E2A;&#x4EE5;&#x4E0A;&#x7684;&#x96F6;&#xFF0C;</span>
<span class="hljs-comment">// &#x5C31;&#x81EA;&#x52A8;&#x8F6C;&#x4E3A;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;</span>
<span class="hljs-number">0.0000003</span> <span class="hljs-comment">// 3e-7</span>

<span class="hljs-comment">// &#x5426;&#x5219;&#xFF0C;&#x5C31;&#x4FDD;&#x6301;&#x539F;&#x6765;&#x7684;&#x5B57;&#x9762;&#x5F62;&#x5F0F;</span>
<span class="hljs-number">0.000003</span> <span class="hljs-comment">// 0.000003</span>
</code></pre>
<h2 id="&#x6570;&#x503C;&#x7684;&#x8FDB;&#x5236;">&#x6570;&#x503C;&#x7684;&#x8FDB;&#x5236;</h2>
<p>&#x4F7F;&#x7528;&#x5B57;&#x9762;&#x91CF;&#xFF08;literal&#xFF09;&#x76F4;&#x63A5;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#x65F6;&#xFF0C;JavaScript &#x5BF9;&#x6574;&#x6570;&#x63D0;&#x4F9B;&#x56DB;&#x79CD;&#x8FDB;&#x5236;&#x7684;&#x8868;&#x793A;&#x65B9;&#x6CD5;&#xFF1A;&#x5341;&#x8FDB;&#x5236;&#x3001;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x3001;&#x516B;&#x8FDB;&#x5236;&#x3001;&#x4E8C;&#x8FDB;&#x5236;&#x3002;</p>
<ul>
<li>&#x5341;&#x8FDB;&#x5236;&#xFF1A;&#x6CA1;&#x6709;&#x524D;&#x5BFC;0&#x7684;&#x6570;&#x503C;&#x3002;</li>
<li>&#x516B;&#x8FDB;&#x5236;&#xFF1A;&#x6709;&#x524D;&#x7F00;<code>0o</code>&#x6216;<code>0O</code>&#x7684;&#x6570;&#x503C;&#xFF0C;&#x6216;&#x8005;&#x6709;&#x524D;&#x5BFC;0&#x3001;&#x4E14;&#x53EA;&#x7528;&#x5230;0-7&#x7684;&#x516B;&#x4E2A;&#x963F;&#x62C9;&#x4F2F;&#x6570;&#x5B57;&#x7684;&#x6570;&#x503C;&#x3002;(&#x524D;&#x7F00;0&#x4E5F;&#x53EF;&#x4F5C;&#x4E3A;&#x516B;&#x8FDB;&#x5236;,&#x5DF2;&#x5E9F;&#x5F03;&#x4F46;&#x53EF;&#x7528;,&#x5EFA;&#x8BAE;&#x4E0D;&#x7528;)</li>
<li>&#x5341;&#x516D;&#x8FDB;&#x5236;&#xFF1A;&#x6709;&#x524D;&#x7F00;<code>0x</code>&#x6216;<code>0X</code>&#x7684;&#x6570;&#x503C;&#x3002;</li>
<li>&#x4E8C;&#x8FDB;&#x5236;&#xFF1A;&#x6709;&#x524D;&#x7F00;<code>0b</code>&#x6216;<code>0B</code>&#x7684;&#x6570;&#x503C;&#x3002;</li>
</ul>
<p>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;JavaScript &#x5185;&#x90E8;&#x4F1A;&#x81EA;&#x52A8;&#x5C06;&#x516B;&#x8FDB;&#x5236;&#x3001;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x3001;&#x4E8C;&#x8FDB;&#x5236;&#x8F6C;&#x4E3A;&#x5341;&#x8FDB;&#x5236;&#x3002;&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E9B;&#x4F8B;&#x5B50;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-number">0xff</span> <span class="hljs-comment">// 255</span>
<span class="hljs-number">0o377</span> <span class="hljs-comment">// 255</span>
<span class="hljs-number">0b11</span> <span class="hljs-comment">// 3</span>
</code></pre>
<p>&#x5982;&#x679C;&#x516B;&#x8FDB;&#x5236;&#x3001;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x3001;&#x4E8C;&#x8FDB;&#x5236;&#x7684;&#x6570;&#x503C;&#x91CC;&#x9762;&#xFF0C;&#x51FA;&#x73B0;&#x4E0D;&#x5C5E;&#x4E8E;&#x8BE5;&#x8FDB;&#x5236;&#x7684;&#x6570;&#x5B57;&#xFF0C;&#x5C31;&#x4F1A;&#x62A5;&#x9519;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-number">0</span>xzz <span class="hljs-comment">// &#x62A5;&#x9519;</span>
<span class="hljs-number">0</span>o88 <span class="hljs-comment">// &#x62A5;&#x9519;</span>
<span class="hljs-number">0</span>b22 <span class="hljs-comment">// &#x62A5;&#x9519;</span>
</code></pre>
<h2 id="&#x7279;&#x6B8A;&#x6570;&#x503C;">&#x7279;&#x6B8A;&#x6570;&#x503C;</h2>
<p>JavaScript &#x63D0;&#x4F9B;&#x4E86;&#x51E0;&#x4E2A;&#x7279;&#x6B8A;&#x7684;&#x6570;&#x503C;&#x3002;</p>
<h3 id="&#x6B63;&#x96F6;&#x548C;&#x8D1F;&#x96F6;">&#x6B63;&#x96F6;&#x548C;&#x8D1F;&#x96F6;</h3>
<p>&#x524D;&#x9762;&#x8BF4;&#x8FC7;&#xFF0C;JavaScript &#x7684;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x4E4B;&#x4E2D;&#xFF0C;&#x6709;&#x4E00;&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#x662F;&#x7B26;&#x53F7;&#x4F4D;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x6570;&#x90FD;&#x6709;&#x4E00;&#x4E2A;&#x5BF9;&#x5E94;&#x7684;&#x8D1F;&#x503C;&#xFF0C;&#x5C31;&#x8FDE;<code>0</code>&#x4E5F;&#x4E0D;&#x4F8B;&#x5916;&#x3002;</p>
<p>JavaScript &#x5185;&#x90E8;&#x5B9E;&#x9645;&#x4E0A;&#x5B58;&#x5728;2&#x4E2A;<code>0</code>&#xFF1A;&#x4E00;&#x4E2A;&#x662F;<code>+0</code>&#xFF0C;&#x4E00;&#x4E2A;&#x662F;<code>-0</code>&#xFF0C;&#x533A;&#x522B;&#x5C31;&#x662F;64&#x4F4D;&#x6D6E;&#x70B9;&#x6570;&#x8868;&#x793A;&#x6CD5;&#x7684;&#x7B26;&#x53F7;&#x4F4D;&#x4E0D;&#x540C;&#x3002;&#x5B83;&#x4EEC;&#x662F;&#x7B49;&#x4EF7;&#x7684;&#x3002;</p>
<p>&#x552F;&#x4E00;&#x6709;&#x533A;&#x522B;&#x7684;&#x573A;&#x5408;&#x662F;&#xFF0C;<code>+0</code>&#x6216;<code>-0</code>&#x5F53;&#x4F5C;&#x5206;&#x6BCD;&#xFF0C;&#x8FD4;&#x56DE;&#x7684;&#x503C;&#x662F;&#x4E0D;&#x76F8;&#x7B49;&#x7684;&#x3002;</p>
<pre><code class="lang-js">(<span class="hljs-number">1</span> / +<span class="hljs-number">0</span>) === (<span class="hljs-number">1</span> / <span class="hljs-number">-0</span>) <span class="hljs-comment">// false</span>
</code></pre>
<h3 id="nan">NaN</h3>
<p><code>NaN</code>&#x662F; JavaScript &#x7684;&#x7279;&#x6B8A;&#x503C;&#xFF0C;&#x8868;&#x793A;&#x201C;&#x975E;&#x6570;&#x5B57;&#x201D;&#xFF08;Not a Number&#xFF09;&#xFF0C;&#x4E3B;&#x8981;&#x51FA;&#x73B0;&#x5728;&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x89E3;&#x6790;&#x6210;&#x6570;&#x5B57;&#x51FA;&#x9519;&#x7684;&#x573A;&#x5408;&#x3002;</p>
<p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;<code>NaN</code>&#x4E0D;&#x662F;&#x72EC;&#x7ACB;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x800C;&#x662F;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x6570;&#x503C;&#xFF0C;&#x5B83;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4F9D;&#x7136;&#x5C5E;&#x4E8E;<code>Number</code>&#xFF0C;&#x4F7F;&#x7528;<code>typeof</code>&#x8FD0;&#x7B97;&#x7B26;&#x53EF;&#x4EE5;&#x770B;&#x5F97;&#x5F88;&#x6E05;&#x695A;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-keyword">typeof</span> <span class="hljs-literal">NaN</span> <span class="hljs-comment">// &apos;number&apos;</span>
</code></pre>
<h4 id="&#x8FD0;&#x7B97;&#x89C4;&#x5219;">&#x8FD0;&#x7B97;&#x89C4;&#x5219;</h4>
<p><code>NaN</code>&#x4E0D;&#x7B49;&#x4E8E;&#x4EFB;&#x4F55;&#x503C;&#xFF0C;&#x5305;&#x62EC;&#x5B83;&#x672C;&#x8EAB;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-literal">NaN</span> === <span class="hljs-literal">NaN</span> <span class="hljs-comment">// false</span>
</code></pre>
<h3 id="infinity">Infinity</h3>
<p><code>Infinity</code>&#x8868;&#x793A;&#x201C;&#x65E0;&#x7A77;&#x201D;&#xFF0C;&#x7528;&#x6765;&#x8868;&#x793A;&#x4E24;&#x79CD;&#x573A;&#x666F;&#x3002;&#x4E00;&#x79CD;&#x662F;&#x4E00;&#x4E2A;&#x6B63;&#x7684;&#x6570;&#x503C;&#x592A;&#x5927;&#xFF0C;&#x6216;&#x4E00;&#x4E2A;&#x8D1F;&#x7684;&#x6570;&#x503C;&#x592A;&#x5C0F;&#xFF0C;&#x65E0;&#x6CD5;&#x8868;&#x793A;&#xFF1B;&#x53E6;&#x4E00;&#x79CD;&#x662F;&#x975E;0&#x6570;&#x503C;&#x9664;&#x4EE5;0&#xFF0C;&#x5F97;&#x5230;<code>Infinity</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x573A;&#x666F;&#x4E00;</span>
<span class="hljs-built_in">Math</span>.pow(<span class="hljs-number">2</span>, <span class="hljs-number">1024</span>)
<span class="hljs-comment">// Infinity</span>

<span class="hljs-comment">// &#x573A;&#x666F;&#x4E8C;</span>
<span class="hljs-number">0</span> / <span class="hljs-number">0</span> <span class="hljs-comment">// NaN</span>
<span class="hljs-number">1</span> / <span class="hljs-number">0</span> <span class="hljs-comment">// Infinity</span>
</code></pre>
<p><code>Infinity</code>&#x6709;&#x6B63;&#x8D1F;&#x4E4B;&#x5206;&#xFF0C;<code>Infinity</code>&#x8868;&#x793A;&#x6B63;&#x7684;&#x65E0;&#x7A77;&#xFF0C;<code>-Infinity</code>&#x8868;&#x793A;&#x8D1F;&#x7684;&#x65E0;&#x7A77;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-literal">Infinity</span> === -<span class="hljs-literal">Infinity</span> <span class="hljs-comment">// false</span>

<span class="hljs-number">1</span> / <span class="hljs-number">-0</span> <span class="hljs-comment">// -Infinity</span>
<span class="hljs-number">-1</span> / <span class="hljs-number">-0</span> <span class="hljs-comment">// Infinity</span>
</code></pre>
<h3 id="&#x4E8C;&#x8FDB;&#x5236;&#x4E0E;&#x516B;&#x8FDB;&#x5236;&#x8868;&#x793A;">&#x4E8C;&#x8FDB;&#x5236;&#x4E0E;&#x516B;&#x8FDB;&#x5236;&#x8868;&#x793A;</h3>
<p>ES6 &#x63D0;&#x4F9B;&#x4E86;&#x4E8C;&#x8FDB;&#x5236;&#x548C;&#x516B;&#x8FDB;&#x5236;&#x6570;&#x503C;&#x7684;&#x65B0;&#x7684;&#x5199;&#x6CD5;&#xFF0C;&#x5206;&#x522B;&#x7528;&#x524D;&#x7F00;<code>0b</code>&#xFF08;&#x6216;<code>0B</code>&#xFF09;&#x548C;<code>0o</code>&#xFF08;&#x6216;<code>0O</code>&#xFF09;&#x8868;&#x793A;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-number">0b111110111</span> === <span class="hljs-number">503</span> <span class="hljs-comment">// true</span>
<span class="hljs-number">0o767</span> === <span class="hljs-number">503</span> <span class="hljs-comment">// true</span>
</code></pre>
<p>&#x5982;&#x679C;&#x8981;&#x5C06;<code>0b</code>&#x548C;<code>0o</code>&#x524D;&#x7F00;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x6570;&#x503C;&#x8F6C;&#x4E3A;&#x5341;&#x8FDB;&#x5236;&#xFF0C;&#x8981;&#x4F7F;&#x7528;<code>Number</code>&#x65B9;&#x6CD5;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>(<span class="hljs-string">&apos;0b111&apos;</span>)  <span class="hljs-comment">// 7</span>
<span class="hljs-built_in">Number</span>(<span class="hljs-string">&apos;0o10&apos;</span>)  <span class="hljs-comment">// 8</span>
</code></pre>
<h3 id="parseintparsefloat">parseInt,parseFloat</h3>
<p>ES6 &#x5C06;&#x5168;&#x5C40;&#x65B9;&#x6CD5;<code>parseInt()</code>&#x548C;<code>parseFloat()</code>&#xFF0C;&#x79FB;&#x690D;&#x5230;<code>Number</code>&#x5BF9;&#x8C61;&#x4E0A;&#x9762;&#xFF0C;&#x884C;&#x4E3A;&#x5B8C;&#x5168;&#x4FDD;&#x6301;&#x4E0D;&#x53D8;&#x3002;</p>
<p>&#x8FD9;&#x6837;&#x505A;&#x7684;&#x76EE;&#x7684;&#xFF0C;&#x662F;&#x9010;&#x6B65;&#x51CF;&#x5C11;&#x5168;&#x5C40;&#x6027;&#x65B9;&#x6CD5;&#xFF0C;&#x4F7F;&#x5F97;&#x8BED;&#x8A00;&#x9010;&#x6B65;&#x6A21;&#x5757;&#x5316;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>.parseInt === <span class="hljs-built_in">parseInt</span> <span class="hljs-comment">// true</span>
<span class="hljs-built_in">Number</span>.parseFloat === <span class="hljs-built_in">parseFloat</span> <span class="hljs-comment">// true</span>
</code></pre>
<p>&#x5B57;&#x7B26;&#x4E32;&#x8F6C;&#x4E3A;&#x6574;&#x6570;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x662F;&#x4E00;&#x4E2A;&#x4E2A;&#x5B57;&#x7B26;&#x4F9D;&#x6B21;&#x8F6C;&#x6362;&#xFF0C;&#x5982;&#x679C;&#x9047;&#x5230;&#x4E0D;&#x80FD;&#x8F6C;&#x4E3A;&#x6570;&#x5B57;&#x7684;&#x5B57;&#x7B26;&#xFF0C;&#x5C31;&#x4E0D;&#x518D;&#x8FDB;&#x884C;&#x4E0B;&#x53BB;&#xFF0C;&#x8FD4;&#x56DE;&#x5DF2;&#x7ECF;&#x8F6C;&#x597D;&#x7684;&#x90E8;&#x5206;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// ES5&#x7684;&#x5199;&#x6CD5;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;12.34&apos;</span>) <span class="hljs-comment">// 12</span>
<span class="hljs-built_in">parseFloat</span>(<span class="hljs-string">&apos;123.45#&apos;</span>) <span class="hljs-comment">// 123.45</span>

<span class="hljs-comment">// ES6&#x7684;&#x5199;&#x6CD5;</span>
<span class="hljs-built_in">Number</span>.parseInt(<span class="hljs-string">&apos;12.34&apos;</span>) <span class="hljs-comment">// 12</span>
<span class="hljs-built_in">Number</span>.parseFloat(<span class="hljs-string">&apos;123.45#&apos;</span>) <span class="hljs-comment">// 123.45</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;<code>parseInt</code>&#x7684;&#x53C2;&#x6570;&#x90FD;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x7ED3;&#x679C;&#x53EA;&#x8FD4;&#x56DE;&#x5B57;&#x7B26;&#x4E32;&#x5934;&#x90E8;&#x53EF;&#x4EE5;&#x8F6C;&#x4E3A;&#x6570;&#x5B57;&#x7684;&#x90E8;&#x5206;&#x3002;</p>
<p>&#x5982;&#x679C;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E0D;&#x80FD;&#x8F6C;&#x5316;&#x4E3A;&#x6570;&#x5B57;&#xFF08;&#x540E;&#x9762;&#x8DDF;&#x7740;&#x6570;&#x5B57;&#x7684;&#x6B63;&#x8D1F;&#x53F7;&#x9664;&#x5916;&#xFF09;&#xFF0C;&#x8FD4;&#x56DE;<code>NaN</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;abc&apos;</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;.3&apos;</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;&apos;</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;+&apos;</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;+1&apos;</span>) <span class="hljs-comment">// 1</span>
</code></pre>
<p>&#x6240;&#x4EE5;&#xFF0C;<code>parseInt</code>&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x53EA;&#x6709;&#x4E24;&#x79CD;&#x53EF;&#x80FD;&#xFF0C;&#x8981;&#x4E48;&#x662F;&#x4E00;&#x4E2A;&#x5341;&#x8FDB;&#x5236;&#x6574;&#x6570;&#xFF0C;&#x8981;&#x4E48;&#x662F;<code>NaN</code>&#x3002;</p>
<p>&#x5982;&#x679C;<code>parseInt</code>&#x7684;&#x53C2;&#x6570;&#x4E0D;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5219;&#x4F1A;&#x5148;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x518D;&#x8F6C;&#x6362;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-number">1.23</span>) <span class="hljs-comment">// 1</span>
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1.23&apos;</span>) <span class="hljs-comment">// 1</span>
</code></pre>
<p>&#x5982;&#x679C;&#x5B57;&#x7B26;&#x4E32;&#x4EE5;<code>0x</code>&#x6216;<code>0X</code>&#x5F00;&#x5934;&#xFF0C;<code>parseInt</code>&#x4F1A;&#x5C06;&#x5176;&#x6309;&#x7167;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x6570;&#x89E3;&#x6790;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;0x10&apos;</span>) <span class="hljs-comment">// 16</span>
</code></pre>
<p>&#x5982;&#x679C;&#x5B57;&#x7B26;&#x4E32;&#x4EE5;<code>0</code>&#x5F00;&#x5934;&#xFF0C;&#x5C06;&#x5176;&#x6309;&#x7167;10&#x8FDB;&#x5236;&#x89E3;&#x6790;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;011&apos;</span>) <span class="hljs-comment">// 11</span>
</code></pre>
<p>&#x5BF9;&#x4E8E;&#x90A3;&#x4E9B;&#x4F1A;&#x81EA;&#x52A8;&#x8F6C;&#x4E3A;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x7684;&#x6570;&#x5B57;&#xFF0C;<code>parseInt</code>&#x4F1A;&#x5C06;&#x79D1;&#x5B66;&#x8BA1;&#x6570;&#x6CD5;&#x7684;&#x8868;&#x793A;&#x65B9;&#x6CD5;&#x89C6;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x56E0;&#x6B64;&#x5BFC;&#x81F4;&#x4E00;&#x4E9B;&#x5947;&#x602A;&#x7684;&#x7ED3;&#x679C;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-number">1000000000000000000000.5</span>) <span class="hljs-comment">// 1</span>
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1e+21&apos;</span>) <span class="hljs-comment">// 1</span>

<span class="hljs-built_in">parseInt</span>(<span class="hljs-number">0.0000008</span>) <span class="hljs-comment">// 8</span>
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;8e-7&apos;</span>) <span class="hljs-comment">// 8</span>
</code></pre>
<h3 id="&#x8FDB;&#x5236;&#x8F6C;&#x6362;"><strong>&#x8FDB;&#x5236;&#x8F6C;&#x6362;</strong></h3>
<p><code>parseInt</code>&#x65B9;&#x6CD5;&#x8FD8;&#x53EF;&#x4EE5;&#x63A5;&#x53D7;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#xFF08;2&#x5230;36&#x4E4B;&#x95F4;&#xFF09;&#xFF0C;&#x8868;&#x793A;&#x88AB;&#x89E3;&#x6790;&#x7684;&#x503C;&#x7684;&#x8FDB;&#x5236;&#xFF0C;&#x8FD4;&#x56DE;&#x8BE5;&#x503C;&#x5BF9;&#x5E94;&#x7684;&#x5341;&#x8FDB;&#x5236;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;<code>parseInt</code>&#x7684;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4E3A;10&#xFF0C;&#x5373;&#x9ED8;&#x8BA4;&#x662F;&#x5341;&#x8FDB;&#x5236;&#x8F6C;&#x5341;&#x8FDB;&#x5236;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1000&apos;</span>) <span class="hljs-comment">// 1000</span>
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1000&apos;</span>, <span class="hljs-number">10</span>) <span class="hljs-comment">// 1000</span>
</code></pre>
<p>&#x4E0B;&#x9762;&#x662F;&#x8F6C;&#x6362;&#x6307;&#x5B9A;&#x8FDB;&#x5236;&#x7684;&#x6570;&#x7684;&#x4F8B;&#x5B50;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1000&apos;</span>, <span class="hljs-number">2</span>) <span class="hljs-comment">// 8</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1000&apos;</span>, <span class="hljs-number">6</span>) <span class="hljs-comment">// 216</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1000&apos;</span>, <span class="hljs-number">8</span>) <span class="hljs-comment">// 512</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x4E8C;&#x8FDB;&#x5236;&#x3001;&#x516D;&#x8FDB;&#x5236;&#x3001;&#x516B;&#x8FDB;&#x5236;&#x7684;<code>1000</code>&#xFF0C;&#x5206;&#x522B;&#x7B49;&#x4E8E;&#x5341;&#x8FDB;&#x5236;&#x7684;8&#x3001;216&#x548C;512&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;<code>parseInt</code>&#x65B9;&#x6CD5;&#x8FDB;&#x884C;&#x8FDB;&#x5236;&#x7684;&#x8F6C;&#x6362;&#x3002;</p>
<p>&#x5982;&#x679C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x4E0D;&#x662F;&#x6570;&#x503C;&#xFF0C;&#x4F1A;&#x88AB;&#x81EA;&#x52A8;&#x8F6C;&#x4E3A;&#x4E00;&#x4E2A;&#x6574;&#x6570;&#x3002;&#x8FD9;&#x4E2A;&#x6574;&#x6570;&#x53EA;&#x6709;&#x5728;2&#x5230;36&#x4E4B;&#x95F4;&#xFF0C;&#x624D;&#x80FD;&#x5F97;&#x5230;&#x6709;&#x610F;&#x4E49;&#x7684;&#x7ED3;&#x679C;&#xFF0C;&#x8D85;&#x51FA;&#x8FD9;&#x4E2A;&#x8303;&#x56F4;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;<code>NaN</code>&#x3002;&#x5982;&#x679C;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;<code>0</code>&#x3001;<code>undefined</code>&#x548C;<code>null</code>&#xFF0C;&#x5219;&#x76F4;&#x63A5;&#x5FFD;&#x7565;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;10&apos;</span>, <span class="hljs-number">37</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;10&apos;</span>, <span class="hljs-number">1</span>) <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;10&apos;</span>, <span class="hljs-number">0</span>) <span class="hljs-comment">// 10</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;10&apos;</span>, <span class="hljs-literal">null</span>) <span class="hljs-comment">// 10</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;10&apos;</span>, <span class="hljs-literal">undefined</span>) <span class="hljs-comment">// 10</span>
</code></pre>
<p>&#x5982;&#x679C;&#x5B57;&#x7B26;&#x4E32;&#x5305;&#x542B;&#x5BF9;&#x4E8E;&#x6307;&#x5B9A;&#x8FDB;&#x5236;&#x65E0;&#x610F;&#x4E49;&#x7684;&#x5B57;&#x7B26;&#xFF0C;&#x5219;&#x4ECE;&#x6700;&#x9AD8;&#x4F4D;&#x5F00;&#x59CB;&#xFF0C;&#x53EA;&#x8FD4;&#x56DE;&#x53EF;&#x4EE5;&#x8F6C;&#x6362;&#x7684;&#x6570;&#x503C;&#x3002;&#x5982;&#x679C;&#x6700;&#x9AD8;&#x4F4D;&#x65E0;&#x6CD5;&#x8F6C;&#x6362;&#xFF0C;&#x5219;&#x76F4;&#x63A5;&#x8FD4;&#x56DE;<code>NaN</code>&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;1546&apos;</span>, <span class="hljs-number">2</span>) <span class="hljs-comment">// 1</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;546&apos;</span>, <span class="hljs-number">2</span>) <span class="hljs-comment">// NaN</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x5BF9;&#x4E8E;&#x4E8C;&#x8FDB;&#x5236;&#x6765;&#x8BF4;&#xFF0C;<code>1</code>&#x662F;&#x6709;&#x610F;&#x4E49;&#x7684;&#x5B57;&#x7B26;&#xFF0C;<code>5</code>&#x3001;<code>4</code>&#x3001;<code>6</code>&#x90FD;&#x662F;&#x65E0;&#x610F;&#x4E49;&#x7684;&#x5B57;&#x7B26;&#xFF0C;&#x6240;&#x4EE5;&#x7B2C;&#x4E00;&#x884C;&#x8FD4;&#x56DE;1&#xFF0C;&#x7B2C;&#x4E8C;&#x884C;&#x8FD4;&#x56DE;<code>NaN</code>&#x3002;</p>
<p>&#x524D;&#x9762;&#x8BF4;&#x8FC7;&#xFF0C;&#x5982;&#x679C;<code>parseInt</code>&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x4E0D;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x4F1A;&#x88AB;&#x5148;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x3002;&#x8FD9;&#x4F1A;&#x5BFC;&#x81F4;&#x4E00;&#x4E9B;&#x4EE4;&#x4EBA;&#x610F;&#x5916;&#x7684;&#x7ED3;&#x679C;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-number">0x11</span>, <span class="hljs-number">36</span>) <span class="hljs-comment">// 43</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-number">0x11</span>, <span class="hljs-number">2</span>) <span class="hljs-comment">// 1</span>

<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">String</span>(<span class="hljs-number">0x11</span>), <span class="hljs-number">36</span>)
<span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">String</span>(<span class="hljs-number">0x11</span>), <span class="hljs-number">2</span>)

<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;17&apos;</span>, <span class="hljs-number">36</span>)
<span class="hljs-built_in">parseInt</span>(<span class="hljs-string">&apos;17&apos;</span>, <span class="hljs-number">2</span>)
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x5341;&#x516D;&#x8FDB;&#x5236;&#x7684;<code>0x11</code>&#x4F1A;&#x88AB;&#x5148;&#x8F6C;&#x4E3A;&#x5341;&#x8FDB;&#x5236;&#x7684;17&#xFF0C;&#x518D;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x3002;&#x7136;&#x540E;&#xFF0C;&#x518D;&#x7528;36&#x8FDB;&#x5236;&#x6216;&#x4E8C;&#x8FDB;&#x5236;&#x89E3;&#x8BFB;&#x5B57;&#x7B26;&#x4E32;<code>17</code>&#xFF0C;&#x6700;&#x540E;&#x8FD4;&#x56DE;&#x7ED3;&#x679C;<code>43</code>&#x548C;<code>1</code>&#x3002;</p>
<p>&#x8FD9;&#x79CD;&#x5904;&#x7406;&#x65B9;&#x5F0F;&#xFF0C;&#x5BF9;&#x4E8E;&#x516B;&#x8FDB;&#x5236;&#x7684;&#x524D;&#x7F00;0&#xFF0C;&#x5C24;&#x5176;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x3002;</p>
<pre><code class="lang-js"><span class="hljs-built_in">parseInt</span>(<span class="hljs-number">011</span>, <span class="hljs-number">2</span>) <span class="hljs-comment">// NaN</span>

<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">String</span>(<span class="hljs-number">011</span>), <span class="hljs-number">2</span>)

<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E;</span>
<span class="hljs-built_in">parseInt</span>(<span class="hljs-built_in">String</span>(<span class="hljs-number">9</span>), <span class="hljs-number">2</span>)
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x7B2C;&#x4E00;&#x884C;&#x7684;<code>011</code>&#x4F1A;&#x88AB;&#x5148;&#x8F6C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;<code>9</code>&#xFF0C;&#x56E0;&#x4E3A;<code>9</code>&#x4E0D;&#x662F;&#x4E8C;&#x8FDB;&#x5236;&#x7684;&#x6709;&#x6548;&#x5B57;&#x7B26;&#xFF0C;&#x6240;&#x4EE5;&#x8FD4;&#x56DE;<code>NaN</code>&#x3002;&#x5982;&#x679C;&#x76F4;&#x63A5;&#x8BA1;&#x7B97;<code>parseInt(&apos;011&apos;, 2)</code>&#xFF0C;<code>011</code>&#x5219;&#x662F;&#x4F1A;&#x88AB;&#x5F53;&#x4F5C;&#x4E8C;&#x8FDB;&#x5236;&#x5904;&#x7406;&#xFF0C;&#x8FD4;&#x56DE;3&#x3002;</p>
<p>JavaScript &#x4E0D;&#x518D;&#x5141;&#x8BB8;&#x5C06;&#x5E26;&#x6709;&#x524D;&#x7F00;0&#x7684;&#x6570;&#x5B57;&#x89C6;&#x4E3A;&#x516B;&#x8FDB;&#x5236;&#x6570;&#xFF0C;&#x800C;&#x662F;&#x8981;&#x6C42;&#x5FFD;&#x7565;&#x8FD9;&#x4E2A;<code>0</code>&#x3002;&#x4F46;&#x662F;&#xFF0C;&#x4E3A;&#x4E86;&#x4FDD;&#x8BC1;&#x517C;&#x5BB9;&#x6027;&#xFF0C;&#x5927;&#x90E8;&#x5206;&#x6D4F;&#x89C8;&#x5668;&#x5E76;&#x6CA1;&#x6709;&#x90E8;&#x7F72;&#x8FD9;&#x4E00;&#x6761;&#x89C4;&#x5B9A;&#x3002;</p>
<h3 id="isinteger">isInteger</h3>
<p><code>Number.isInteger()</code>&#x7528;&#x6765;&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#x662F;&#x5426;&#x4E3A;&#x6574;&#x6570;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-number">25</span>) <span class="hljs-comment">// true</span>
<span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-number">25.1</span>) <span class="hljs-comment">// false</span>
</code></pre>
<p>JavaScript &#x5185;&#x90E8;&#xFF0C;&#x6574;&#x6570;&#x548C;&#x6D6E;&#x70B9;&#x6570;&#x91C7;&#x7528;&#x7684;&#x662F;&#x540C;&#x6837;&#x7684;&#x50A8;&#x5B58;&#x65B9;&#x6CD5;&#xFF0C;&#x6240;&#x4EE5; 25 &#x548C; 25.0 &#x88AB;&#x89C6;&#x4E3A;&#x540C;&#x4E00;&#x4E2A;&#x503C;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-number">25</span>) <span class="hljs-comment">// true</span>
<span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-number">25.0</span>) <span class="hljs-comment">// true</span>
</code></pre>
<p>&#x5982;&#x679C;&#x53C2;&#x6570;&#x4E0D;&#x662F;&#x6570;&#x503C;&#xFF0C;<code>Number.isInteger</code>&#x8FD4;&#x56DE;<code>false</code>&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>.isInteger() <span class="hljs-comment">// false</span>
<span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-literal">null</span>) <span class="hljs-comment">// false</span>
<span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-string">&apos;15&apos;</span>) <span class="hljs-comment">// false</span>
<span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-literal">true</span>) <span class="hljs-comment">// false</span>
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x7531;&#x4E8E; JavaScript &#x91C7;&#x7528; IEEE 754 &#x6807;&#x51C6;&#xFF0C;&#x6570;&#x503C;&#x5B58;&#x50A8;&#x4E3A;64&#x4F4D;&#x53CC;&#x7CBE;&#x5EA6;&#x683C;&#x5F0F;&#xFF0C;&#x6570;&#x503C;&#x7CBE;&#x5EA6;&#x6700;&#x591A;&#x53EF;&#x4EE5;&#x8FBE;&#x5230; 53 &#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF08;1 &#x4E2A;&#x9690;&#x85CF;&#x4F4D;&#x4E0E; 52 &#x4E2A;&#x6709;&#x6548;&#x4F4D;&#xFF09;&#x3002;&#x5982;&#x679C;&#x6570;&#x503C;&#x7684;&#x7CBE;&#x5EA6;&#x8D85;&#x8FC7;&#x8FD9;&#x4E2A;&#x9650;&#x5EA6;&#xFF0C;&#x7B2C;54&#x4F4D;&#x53CA;&#x540E;&#x9762;&#x7684;&#x4F4D;&#x5C31;&#x4F1A;&#x88AB;&#x4E22;&#x5F03;&#xFF0C;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;<code>Number.isInteger</code>&#x53EF;&#x80FD;&#x4F1A;&#x8BEF;&#x5224;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Number</span>.isInteger(<span class="hljs-number">3.0000000000000002</span>) <span class="hljs-comment">// true</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;<code>Number.isInteger</code>&#x7684;&#x53C2;&#x6570;&#x660E;&#x660E;&#x4E0D;&#x662F;&#x6574;&#x6570;&#xFF0C;&#x4F46;&#x662F;&#x4F1A;&#x8FD4;&#x56DE;<code>true</code>&#x3002;&#x539F;&#x56E0;&#x5C31;&#x662F;&#x8FD9;&#x4E2A;&#x5C0F;&#x6570;&#x7684;&#x7CBE;&#x5EA6;&#x8FBE;&#x5230;&#x4E86;&#x5C0F;&#x6570;&#x70B9;&#x540E;16&#x4E2A;&#x5341;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x8F6C;&#x6210;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#x8D85;&#x8FC7;&#x4E86;53&#x4E2A;&#x4E8C;&#x8FDB;&#x5236;&#x4F4D;&#xFF0C;&#x5BFC;&#x81F4;&#x6700;&#x540E;&#x7684;&#x90A3;&#x4E2A;<code>2</code>&#x88AB;&#x4E22;&#x5F03;&#x4E86;&#x3002;</p>
<p>&#x603B;&#x4E4B;&#xFF0C;&#x5982;&#x679C;&#x5BF9;&#x6570;&#x636E;&#x7CBE;&#x5EA6;&#x7684;&#x8981;&#x6C42;&#x8F83;&#x9AD8;&#xFF0C;&#x4E0D;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;<code>Number.isInteger()</code>&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#x662F;&#x5426;&#x4E3A;&#x6574;&#x6570;&#x3002;</p>
<h3 id="tofixed">toFixed()</h3>
<p>&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x6307;&#x5B9A;&#x4F4D;&#x6570;&#x7684;&#x7684;&#x5C0F;&#x6570;&#x7684;&#x5B57;&#x7B26;&#x4E32;</p>
<pre><code class="lang-javascript"> <span class="hljs-keyword">var</span> x = <span class="hljs-number">9.656</span>;
x.toFixed(<span class="hljs-number">0</span>);           <span class="hljs-comment">// returns 10</span>
x.toFixed(<span class="hljs-number">2</span>);           <span class="hljs-comment">// returns 9.66</span>
x.toFixed(<span class="hljs-number">4</span>);           <span class="hljs-comment">// returns 9.6560</span>
x.toFixed(<span class="hljs-number">6</span>);           <span class="hljs-comment">// returns 9.656000</span>
</code></pre>
<h3 id="mathtrunc">Math.trunc()</h3>
<p><code>Math.trunc</code>&#x65B9;&#x6CD5;&#x7528;&#x4E8E;&#x53BB;&#x9664;&#x4E00;&#x4E2A;&#x6570;&#x7684;&#x5C0F;&#x6570;&#x90E8;&#x5206;&#xFF0C;&#x8FD4;&#x56DE;&#x6574;&#x6570;&#x90E8;&#x5206;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Math</span>.trunc(<span class="hljs-number">4.1</span>) <span class="hljs-comment">// 4</span>
<span class="hljs-built_in">Math</span>.trunc(<span class="hljs-number">4.9</span>) <span class="hljs-comment">// 4</span>
<span class="hljs-built_in">Math</span>.trunc(<span class="hljs-number">-4.1</span>) <span class="hljs-comment">// -4</span>
<span class="hljs-built_in">Math</span>.trunc(<span class="hljs-number">-4.9</span>) <span class="hljs-comment">// -4</span>
<span class="hljs-built_in">Math</span>.trunc(<span class="hljs-number">-0.1234</span>) <span class="hljs-comment">// -0</span>
</code></pre>
<h3 id="mathhypot">Math.hypot()</h3>
<p><code>Math.hypot</code>&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x6240;&#x6709;&#x53C2;&#x6570;&#x7684;&#x5E73;&#x65B9;&#x548C;&#x7684;&#x5E73;&#x65B9;&#x6839;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-built_in">Math</span>.hypot(<span class="hljs-number">3</span>, <span class="hljs-number">4</span>);        <span class="hljs-comment">// 5</span>
<span class="hljs-built_in">Math</span>.hypot(<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>);     <span class="hljs-comment">// 7.0710678118654755</span>
<span class="hljs-built_in">Math</span>.hypot();            <span class="hljs-comment">// 0</span>
<span class="hljs-built_in">Math</span>.hypot(<span class="hljs-literal">NaN</span>);         <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">Math</span>.hypot(<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-string">&apos;foo&apos;</span>); <span class="hljs-comment">// NaN</span>
<span class="hljs-built_in">Math</span>.hypot(<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-string">&apos;5&apos;</span>);   <span class="hljs-comment">// 7.0710678118654755</span>
<span class="hljs-built_in">Math</span>.hypot(<span class="hljs-number">-3</span>);          <span class="hljs-comment">// 3</span>
</code></pre>
<h3 id="&#x6307;&#x6570;&#x8FD0;&#x7B97;">&#x6307;&#x6570;&#x8FD0;&#x7B97;</h3>
<p>ES2016 &#x65B0;&#x589E;&#x4E86;&#x4E00;&#x4E2A;&#x6307;&#x6570;&#x8FD0;&#x7B97;&#x7B26;&#xFF08;<code>**</code>&#xFF09;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-number">2</span> ** <span class="hljs-number">2</span> <span class="hljs-comment">// 4</span>
<span class="hljs-number">2</span> ** <span class="hljs-number">3</span> <span class="hljs-comment">// 8</span>
</code></pre>
<p>&#x8FD9;&#x4E2A;&#x8FD0;&#x7B97;&#x7B26;&#x7684;&#x4E00;&#x4E2A;&#x7279;&#x70B9;&#x662F;&#x53F3;&#x7ED3;&#x5408;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x5E38;&#x89C1;&#x7684;&#x5DE6;&#x7ED3;&#x5408;&#x3002;&#x591A;&#x4E2A;&#x6307;&#x6570;&#x8FD0;&#x7B97;&#x7B26;&#x8FDE;&#x7528;&#x65F6;&#xFF0C;&#x662F;&#x4ECE;&#x6700;&#x53F3;&#x8FB9;&#x5F00;&#x59CB;&#x8BA1;&#x7B97;&#x7684;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// &#x76F8;&#x5F53;&#x4E8E; 2 ** (3 ** 2)</span>
<span class="hljs-number">2</span> ** <span class="hljs-number">3</span> ** <span class="hljs-number">2</span>
<span class="hljs-comment">// 512</span>
</code></pre>
<p>&#x4E0A;&#x9762;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x9996;&#x5148;&#x8BA1;&#x7B97;&#x7684;&#x662F;&#x7B2C;&#x4E8C;&#x4E2A;&#x6307;&#x6570;&#x8FD0;&#x7B97;&#x7B26;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x7B2C;&#x4E00;&#x4E2A;&#x3002;</p>
<p>&#x6307;&#x6570;&#x8FD0;&#x7B97;&#x7B26;&#x53EF;&#x4EE5;&#x4E0E;&#x7B49;&#x53F7;&#x7ED3;&#x5408;&#xFF0C;&#x5F62;&#x6210;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x8D4B;&#x503C;&#x8FD0;&#x7B97;&#x7B26;&#xFF08;<code>**=</code>&#xFF09;&#x3002;</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> a = <span class="hljs-number">1.5</span>;
a **= <span class="hljs-number">2</span>;
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E; a = a * a;</span>

<span class="hljs-keyword">let</span> b = <span class="hljs-number">4</span>;
b **= <span class="hljs-number">3</span>;
<span class="hljs-comment">// &#x7B49;&#x540C;&#x4E8E; b = b * b * b;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="let和const命令.html" class="navigation navigation-prev " aria-label="Previous page: let和const命令">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="字符串.html" class="navigation navigation-next " aria-label="Next page: 字符串">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"数值","level":"1.2.3","depth":2,"next":{"title":"字符串","level":"1.2.4","depth":2,"path":"基础/字符串.md","ref":"基础/字符串.md","articles":[]},"previous":{"title":"let和const命令","level":"1.2.2","depth":2,"path":"基础/let和const命令.md","ref":"基础/let和const命令.md","articles":[]},"dir":"ltr"},"config":{"plugins":["lunr","pageview-count","chapter-fold","back-to-top-button","code","hide-element","-sharing","sharing-plus","custom-favicon"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"ignoreSpecialCharacters":false,"maxIndexSize":1000000},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"favicon":"js.ico","back-to-top-button":{},"pageview-count":{},"custom-favicon":{},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":true,"facebook":true,"weibo":true,"twitter":true,"pocket":true,"google":true,"qzone":true},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Veng","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"JavaScript学习","language":"zh-hans","gitbook":"*","description":"javaScript的学习笔记"},"file":{"path":"基础/数值.md","mtime":"2020-12-10T02:10:04.990Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-10T03:00:51.663Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

